﻿/******************************************************************************
 * Name         : LoginPlayerFactory.cpp
 * Author       : 671643387
 * Date         : 2015年9月21日
 * Description  :
 *****************************************************************************/

#include <boost/bind.hpp>
#include "LoginPlayerFactory.hpp"
using namespace sxr::login_server;

LoginPlayerFactory::LoginPlayerFactory()
{

}

LoginPlayerFactory::~LoginPlayerFactory()
{

}

LoginPlayerPtr LoginPlayerFactory::create(int id, dev::net::TcpConnectionPtr& conn)
{
    // TODO: 使用内存池
    return LoginPlayerPtr(new LoginPlayer(id, conn),
        boost::bind(&LoginPlayerFactory::destroyPlayer, this, _1));
}

void LoginPlayerFactory::destroyPlayer(LoginPlayer* player)
{
    // TODO:
    delete player;
}